<template>
  <el-card class="table">
    <el-button type="success" round class="addBtn" @click="$router.push('/information/details')">新增仓库</el-button>
    <el-table
      :data="tableData"
      border
      style="width: 100%"
    >
      <el-table-column
        type="index"
        label="序号"
        width="150"
        align="center"
      />
      <el-table-column
        prop="code"
        label="仓库编码"
        width="120"
        align="center"
      />
      <el-table-column
        prop="name"
        label="仓库名称"
        width="120"
        align="center"
      />
      <el-table-column
        prop="type"
        label="仓库类型"
        width="120"
        align="center"
      />
      <el-table-column
        prop="location"
        label="省/市/区"
        width="300"
        align="center"
      />
      <el-table-column
        prop="address"
        label="详细地址"
        width="10"
        align="center"
      />
      <el-table-column
        prop="status"
        label="仓库状态"
        width="120"
        align="center"
      />
      <el-table-column
        prop="surface"
        label="仓库面积"
        width="120"
        align="center"
      />
      <el-table-column
        prop="includedNum"
        label="库区数量"
        width="120"
        align="center"
      />
      <el-table-column
        prop="personName"
        label="负责人"
        width="120"
        align="center"
      />
      <el-table-column
        prop="phone"
        label="联系电话"
        width="120"
        align="center"
      />
      <el-table-column
        prop="updateTime"
        label="更新时间"
        width="180"
        align="center"
      />
      <el-table-column
        fixed="right"
        label="操作"
        width="150"
        align="center"
      >
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleClick(scope.row)">编辑</el-button>
          <el-button type="text" size="small">停用</el-button>
          <el-button type="text" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      required: true
    }
  },

  data() {
    return {

    }
  },
  methods: {
    handleClick(row) {
      console.log(row)
    }
  }
}
</script>

<style lang="scss" scoped>
.table{
    margin: 20px;
    .addBtn{
        margin-bottom: 20px;
    }
}
</style>
